﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cofe.Core;
using Cofe.Core.Implements;
using Cofe.IO;

namespace COFE3.Diagram
{
    class Program
    {
        static string RootPath = @"C:\Temp\COFE3";

        static void Main(string[] args)
        {
            ManualServiceImporter msi = new ManualServiceImporter();
            msi.RegisterCOFECore();
            msi.RegisterCOFEIO();
            CofeServices.ImportServices(msi);

            VolumeFE.MapAsync("SystemIO", "cofe", Tuple.Create("VolumePath", RootPath)).Wait();

            IFileInfo file1 = FileFE.FromFilePathAsync("{cofe}\\testParse1.txt").Result;
	        IDirectoryInfo rootDir = DirectoryFE.FromDirectoryPathAsync("{cofe}").Result;
	        //Actually it calls EntryFE.ParsePathAsync(), then cast using As() method.
	        rootDir = (EntryFE.ParsePathAsync("{cofe}")).Result.As<IDirectoryInfo>();
            Console.WriteLine(rootDir.ParseName);
            Console.ReadLine();
        }
    }
}
